//
// Created by rengen.gong on 2021/12/6.
//

#ifndef LEARN1_VIRTUALEXTENDSDEMO_H
#define LEARN1_VIRTUALEXTENDSDEMO_H

#include "iostream"
#include "string"

using namespace std;

class VA {
public:
    virtual
    void printA() {
        cout << "A====" << endl;
        string s = "ddsfsdf";

    }
};

class VB : public virtual VA {

public:
    void printA() {
        VA::printA();
        cout << "B====" << endl;
    }

};

class VC : public virtual VA {

public:
    void printA() {
        VA::printA();
        cout << "C====" << endl;
    }

};

class VD : public VC, public VB {

public:
    void printA() {
        //这就类似java里面的 super.xxx
        VA::printA();
        cout << "D====" << endl;
    }
};

#endif //LEARN1_VIRTUALEXTENDSDEMO_H
